<?php

// uncomment the following to define a path alias
// Yii::setPathOfAlias('local','path/to/local-folder');

// This is the main Web application configuration. Any writable
// CWebApplication properties can be configured here.
return array(
	'basePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..',
    'name'=>'桂林电子科技大学测控技术与仪器虚拟仿真实验教学中心',
    	'language'=>'zh_cn',
	// preloading 'log' component
	'preload'=>array('log'),

	// autoloading model and component classes
	'import'=>array(
		'application.models.*',
        'application.components.*',
        'application.modules.srbac.controllers.SBaseController',
    ),

	'modules'=>array(
		// uncomment the following to enable the Gii tool
		'gii'=>array(
			'class'=>'system.gii.GiiModule',
			'password'=>'guet_cltc',
			// If removed, Gii defaults to localhost only. Edit carefully to taste.
			'ipFilters'=>array('127.0.0.1','::1'),
		),
        'admin',
        'srbac'=> array(
            'userclass'=>'User',      //用户model名字段
            'userid'=>'user_id',            //用户表user_id的标识字段
            'username'=>'user_name',    //用户表username的标识字段
            'delimeter'=>'/',          //控制器名和方法的分割线（在Srbac模块中的体现）
            'debug'=>true,             //debug模式为真，Srbac模块失效，debug模式为假，Srbac模块工作
            'pageSize'=>10,            //Srbac模块中的分页设置
            'superUser' =>'admin', // Srbac中最高权限管理者名称
            'css'=>'srbac.css',        //Srbac加载的CSS样式
            'layout'=>'application.views.layouts.main',   //Srbac模块展现的主题模版
            'notAuthorizedView'=>'srbac.views.authitem.unauthorized',   //非自动验证视图
            'alwaysAllowed'=>array(    //默认不分权限管理的action动作
                'SiteLogin','SiteLogout','SiteIndex','SiteAdmin',
                'SiteError', 'SiteContact',
            ),
            'userActions'=>array('Show','View','List'),     //User 默认的动作
            'listBoxNumberOfLines' => 15,                  //Srbac模块中的listbox分页
            'imagesPath' => 'srbac.images',                //Srbac模块加载图文件夹
            'imagesPack'=>'tango',                         //Srbac模块主题的风格noia，tango两种
            'iconText'=>true,                              //图片上显示文本，为真有文本，为假只有图标
            'header'=>'srbac.views.authitem.header',   //Srbac模块视图的view头部
            'footer'=>'srbac.views.authitem.footer',   //Srbac模块视图的view页尾
            'showHeader'=>true,      //显示视图头部
            'showFooter'=>true,      //显示视图尾部
            'alwaysAllowedPath'=>'srbac.components',   //默认加载Srbac的核心文件地址
        ),
    ),

	// application components
	'components'=>array(
		'user'=>array(
			// enable cookie-based authentication
			'allowAutoLogin'=>true,
		),
		// uncomment the following to enable URLs in path-format
        'widgetFactory'=>array(
            'widgets'=>array(
                'CGridView'=>array(
					'itemsCssClass'=>'table table-stripped table-bordered table-hover',
                ),
            ),
        ),
		'urlManager'=>array(
			'urlFormat'=>'path',
			'rules'=>array(
				'<controller:\w+>/<id:\d+>'=>'<controller>/view',
				'<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',
				'<controller:\w+>/<action:\w+>'=>'<controller>/<action>',    
				'display/<action:\w+>/<sid>/<mid>'=>'display/<action>',
				'admin/<controller:\w+>/<action:\w+>'=>'admin/<controller>/<action>',
				'admin/<controller:\w+>/<action:\w+>/<id:\d+>'=>'admin/<controller>/<action>',
			),
            'showScriptName'=>false,
			'urlSuffix'=>'.html',
        ),
        /*
		'db'=>array(
			'connectionString' => 'sqlite:'.dirname(__FILE__).'/../data/testdrive.db',
		),
		// uncomment the following to use a MySQL database
		*/
		'db'=>array(
			'connectionString' => 'mysql:host=localhost;dbname=vsetc',
			'emulatePrepare' => true,
			'username' => 'cetcAdmin',
			'password' => 'cetcAdmin',
			'charset' => 'utf8',
        ),
        'authManager'=>array(
            'class'=>'application.modules.srbac.components.SDbAuthManager',
            'connectionID'=>'db',
        ),
		'errorHandler'=>array(
			// use 'site/error' action to display errors
			'errorAction'=>'site/error',
		),
		'log'=>array(
			'class'=>'CLogRouter',
			'routes'=>array(
				array(
					'class'=>'CFileLogRoute',
					'levels'=>'error, warning',
				),
				// uncomment the following to show log messages on web pages
				/*
				array(
					'class'=>'CWebLogRoute',
				),
				*/
			),
		),
        'widgetFactory'=>array(
			'widgets'=>array(
				'CGridView'=>array(
					'htmlOptions'=>array(
					),
					'itemsCssClass'=>'table table-stripped table-bordered table-hover',
				),
				'CDetailView'=>array(
					'htmlOptions'=>array(
					'class'=>'table table-stripped table-bordered tabl-hover',
					),
					'itemCssClass'=>'table table-stripped table-bordered tabl-hover',
				),
			),
		),
    ),
   'theme'=>'abound',
	// application-level parameters that can be accessed
	// using Yii::app()->params['paramName']
	'params'=>array(
		// this is used in contact page
        'pageSize'=>20,
        'imageType'=>'jpg|png|bmp|icon',
        'upload_teachingResource'=>yii::app()->basePath.'upload/Teaching Resource/',
        'upload_courseResource'=>yii::app()->basePath.'upload/Course Resource/',
        'upload_avatar'=>yii::app()->basePath.'upload/Avatar/',
        'upload_newsImage'=>yii::app()->basePath.'upload/News Images/',
        'upload_instrument'=>yii::app()->basePath.'upload/Instrument/',
        'upload_labImage'=>yii::app()->basePath.'upload/LabImages/',
        'upload_linkImage'=>yii::app()->basePath.'upload/LinkImages/',
	),
);
